package com.tc.zigbee.zcl;

import java.util.HashMap;
import java.util.Map;

public class ZclConstants {

	/********************************/
	/*** Basic Cluster Attributes ***/
	/********************************/
	// Basic Device Information
	static public final short ATTRID_BASIC_ZCL_VERSION = 0x0000;
	static public final short ATTRID_BASIC_APPL_VERSION                  =      0x0001;
	static public final short ATTRID_BASIC_STACK_VERSION                 =      0x0002;
	static public final short ATTRID_BASIC_HW_VERSION                    =      0x0003;
	static public final short ATTRID_BASIC_MANUFACTURER_NAME             =      0x0004;
	static public final short ATTRID_BASIC_MODEL_ID                      =      0x0005;
	static public final short ATTRID_BASIC_DATE_CODE                     =      0x0006;
	static public final short ATTRID_BASIC_POWER_SOURCE                  =      0x0007;
	// Basic Device Settings
	static public final short ATTRID_BASIC_LOCATION_DESC                 =      0x0010;
	static public final short ATTRID_BASIC_PHYSICAL_ENV                  =      0x0011;
	static public final short ATTRID_BASIC_DEVICE_ENABLED                =      0x0012;
	static public final short ATTRID_BASIC_ALARM_MASK                    =      0x0013;

	/*** Power Source Attribute values ***/
	// Bits b0-b6 represent the primary power source of the device
	static public final byte POWER_SOURCE_UNKNOWN                       =      0x00;
	static public final byte POWER_SOURCE_MAINS_1_PHASE                 =      0x01;
	static public final byte POWER_SOURCE_MAINS_3_PHASE                 =      0x02;
	static public final byte POWER_SOURCE_BATTERY                       =      0x03;
	static public final byte POWER_SOURCE_DC                            =      0x04;
	static public final byte POWER_SOURCE_EMERG_MAINS_CONST_PWR         =      0x05;
	static public final byte POWER_SOURCE_EMERG_MAINS_XFER_SW           =      0x06;
	// Bit b7 indicates whether the device has a secondary power source in the
	// form of a battery backup

	/*** Power Source Attribute bits  ***/
	static public final byte POWER_SOURCE_PRIMARY                       =      0x7F;
	static public final byte POWER_SOURCE_SECONDARY                     =      (byte)0x80;

	/*** Physical Environment Attribute values ***/
	static public final byte PHY_UNSPECIFIED_ENV                        =      0x00;
	// Specified per Profile 0x01-0x7F
	static public final byte PHY_UNKNOWN_ENV                            =      (byte)0xFF;

	/*** Device Enable Attribute values ***/
	static public final byte DEVICE_DISABLED                            =      0x00;
	static public final byte DEVICE_ENABLED                             =      0x01;

	/*** Alarm Mask Attribute bits ***/
	static public final byte ALARM_MASK_GEN_HW_FAULT                    =      0x01;
	static public final byte ALARM_MASK_GEN_SW_FAULT                    =      0x02;

	/******************************/
	/*** Basic Cluster Commands ***/
	/******************************/
	static public final byte COMMAND_BASIC_RESET_FACT_DEFAULT           =      0x00;

	/**********************************************/
	/*** Power Configuration Cluster Attributes ***/
	/**********************************************/
	// Mains Information
	static public final short ATTRID_POWER_CFG_MAINS_VOLTAGE             =      0x0000;
	static public final short ATTRID_POWER_CFG_MAINS_FREQUENCY           =      0x0001;
	// Mains Settings
	static public final short ATTRID_POWER_CFG_MAINS_ALARM_MASK          =      0x0010;
	static public final short ATTRID_POWER_CFG_MAINS_VOLT_MIN_THRES      =      0x0011;
	static public final short ATTRID_POWER_CFG_MAINS_VOLT_MAX_THRES      =      0x0012;
	static public final short ATTRID_POWER_CFG_MAINS_DWELL_TRIP_POINT    =      0x0013;
	// Battery Information
	static public final short ATTRID_POWER_CFG_BATTERY_VOLTAGE           =      0x0020;
	// Battery Settings
	static public final short ATTRID_POWER_CFG_BAT_MANU                  =      0x0030;
	static public final short ATTRID_POWER_CFG_BAT_SIZE                  =      0x0031;
	static public final short ATTRID_POWER_CFG_BAT_AHR_RATING            =      0x0032;
	static public final short ATTRID_POWER_CFG_BAT_QUANTITY              =      0x0033;
	static public final short ATTRID_POWER_CFG_BAT_RATED_VOLTAGE         =      0x0034;
	static public final short ATTRID_POWER_CFG_BAT_ALARM_MASK            =      0x0035;
	static public final short ATTRID_POWER_CFG_BAT_VOLT_MIN_THRES        =      0x0036;

	/*** Mains Alarm Mask Attribute bit ***/
	static public final byte MAINS_ALARM_MASK_VOLT_2_LOW                =      0x01;
	static public final byte MAINS_ALARM_MASK_VOLT_2_HI                 =      0x02;

	/*** Battery Size Attribute values ***/
	static public final byte BAT_SIZE_NO_BATTERY                        =      0x00;
	static public final byte BAT_SIZE_BUILT_IN                          =      0x01;
	static public final byte BAT_SIZE_OTHER                             =      0x02;
	static public final byte BAT_SIZE_AA                                =      0x03;
	static public final byte BAT_SIZE_AAA                               =      0x04;
	static public final byte BAT_SIZE_C                                 =      0x05;
	static public final byte BAT_SIZE_D                                 =      0x06;
	static public final byte BAT_SIZE_UNKNOWN                           =      (byte)0xFF;

	/*** Batter Alarm Mask Attribute bit ***/
	static public final byte BAT_ALARM_MASK_VOLT_2_LOW                  =      0x01;

	/********************************************/
	/*** Power Configuration Cluster Commands ***/
	/********************************************/
	// No cluster specific commands

	/***********************************************************/
	/*** Device Temperature Configuration Cluster Attributes ***/
	/***********************************************************/
	// Device Temperature Information
	static public final short ATTRID_DEV_TEMP_CURRENT                    =      0x0000;
	static public final short ATTRID_DEV_TEMP_MIN_EXPERIENCED            =      0x0001;
	static public final short ATTRID_DEV_TEMP_MAX_EXPERIENCED            =      0x0002;
	static public final short ATTRID_DEV_TEMP_OVER_TOTAL_DWELL           =      0x0003;
	// Device Temperature Settings
	static public final short ATTRID_DEV_TEMP_ALARM_MASK                 =      0x0010;
	static public final short ATTRID_DEV_TEMP_LOW_THRES                  =      0x0011;
	static public final short ATTRID_DEV_TEMP_HI_THRES                   =      0x0012;
	static public final short ATTRID_DEV_TEMP_LOW_DWELL_TRIP_POINT       =      0x0013;
	static public final short ATTRID_DEV_TEMP_HI_DWELL_TRIP_POINT        =      0x0014;

	/*** Device Temp Alarm_Mask Attribute bits ***/
	static public final byte DEV_TEMP_ALARM_MASK_2_LOW                  =      0x01;
	static public final byte DEV_TEMP_ALARM_MASK_2_HI                   =      0x02;

	/*********************************************************/
	/*** Device Temperature Configuration Cluster Commands ***/
	/*********************************************************/
	// No cluster specific commands

	/***********************************/
	/*** Identify Cluster Attributes ***/
	/***********************************/
	static public final short ATTRID_IDENTIFY_TIME                      =      0x0000;

	/*********************************/
	/*** Identify Cluster Commands ***/
	/*********************************/
	static public final byte COMMAND_IDENTIFY                          =      0x00;
	static public final byte COMMAND_IDENTIFY_QUERY                    =      0x01;

	static public final byte COMMAND_IDENTIFY_QUERY_RSP                =      0x00;

	/********************************/
	/*** Group Cluster Attributes ***/
	/********************************/
	static public final short ATTRID_GROUP_NAME_SUPPORT                  =      0x0000;

	/******************************/
	/*** Group Cluster Commands ***/
	/******************************/
	static public final byte COMMAND_GROUP_ADD                          =      0x00;
	static public final byte COMMAND_GROUP_VIEW                         =      0x01;
	static public final byte COMMAND_GROUP_GET_MEMBERSHIP               =      0x02;
	static public final byte COMMAND_GROUP_REMOVE                       =      0x03;
	static public final byte COMMAND_GROUP_REMOVE_ALL                   =      0x04;
	static public final byte COMMAND_GROUP_ADD_IF_IDENTIFYING           =      0x05;

	static public final byte COMMAND_GROUP_ADD_RSP                      =      0x00;
	static public final byte COMMAND_GROUP_VIEW_RSP                     =      0x01;
	static public final byte COMMAND_GROUP_GET_MEMBERSHIP_RSP           =      0x02;
	static public final byte COMMAND_GROUP_REMOVE_RSP                   =      0x03;

	/*********************************/
	/*** Scenes Cluster Attributes ***/
	/*********************************/
	// Scene Management Information
	static public final short ATTRID_SCENES_COUNT                        =      0x0000;
	static public final short ATTRID_SCENES_CURRENT_SCENE                =      0x0001;
	static public final short ATTRID_SCENES_CURRENT_GROUP                =      0x0002;
	static public final short ATTRID_SCENES_SCENE_VALID                  =      0x0003;
	static public final short ATTRID_SCENES_NAME_SUPPORT                 =      0x0004;
	static public final short ATTRID_SCENES_LAST_CFG_BY                  =      0x0005;

	/*******************************/
	/*** Scenes Cluster Commands ***/
	/*******************************/
	static public final byte COMMAND_SCENE_ADD                          =      0x00;
	static public final byte COMMAND_SCENE_VIEW                         =      0x01;
	static public final byte COMMAND_SCENE_REMOVE                       =      0x02;
	static public final byte COMMAND_SCENE_REMOVE_ALL                   =      0x03;
	static public final byte COMMAND_SCENE_STORE                        =      0x04;
	static public final byte COMMAND_SCENE_RECALL                       =      0x05;
	static public final byte COMMAND_SCENE_GET_MEMBERSHIP               =      0x06;

	static public final byte COMMAND_SCENE_ADD_RSP                      =      0x00;
	static public final byte COMMAND_SCENE_VIEW_RSP                     =      0x01;
	static public final byte COMMAND_SCENE_REMOVE_RSP                   =      0x02;
	static public final byte COMMAND_SCENE_REMOVE_ALL_RSP               =      0x03;
	static public final byte COMMAND_SCENE_STORE_RSP                    =      0x04;
	static public final byte COMMAND_SCENE_GET_MEMBERSHIP_RSP           =      0x06;

	/*********************************/
	/*** On/Off Cluster Attributes ***/
	/*********************************/
	static public final short ATTRID_ON_OFF                              =      0x0000;

	/*******************************/
	/*** On/Off Cluster Commands ***/
	/*******************************/
	static public final byte COMMAND_OFF                                =      0x00;
	static public final byte COMMAND_ON                                 =      0x01;
	static public final byte COMMAND_TOGGLE                             =      0x02;

	/****************************************/
	/*** On/Off Switch Cluster Attributes ***/
	/****************************************/
	// Switch Information
	static public final short ATTRID_ON_OFF_SWITCH_TYPE                  =      0x0000;
	// Switch Settings
	static public final short ATTRID_ON_OFF_SWITCH_ACTIONS               =      0x0010;

	/*** On Off Switch Type attribute values ***/
	static public final byte ON_OFF_SWITCH_TYPE_TOGGLE                  =      0x00;
	static public final byte ON_OFF_SWITCH_TYPE_MOMENTARY               =      0x01;

	/*** On Off Switch Actions attribute values ***/
	static public final byte ON_OFF_SWITCH_ACTIONS_0                    =      0x00;
	static public final byte ON_OFF_SWITCH_ACTIONS_1                    =      0x01;
	static public final byte ON_OFF_SWITCH_ACTIONS_2                    =      0x02;

	/**************************************/
	/*** On/Off Switch Cluster Commands ***/
	/**************************************/
	// No cluster specific commands

	/****************************************/
	/*** Level Control Cluster Attributes ***/
	/****************************************/
	static public final short ATTRID_LEVEL_CURRENT_LEVEL                 =      0x0000;
	static public final short ATTRID_LEVEL_REMAINING_TIME                =      0x0001;
	static public final short ATTRID_LEVEL_ON_OFF_TRANSITION_TIME        =      0x0010;
	static public final short ATTRID_LEVEL_ON_LEVEL                      =      0x0011;

	/**************************************/
	/*** Level Control Cluster Commands ***/
	/**************************************/
	static public final byte COMMAND_LEVEL_MOVE_TO_LEVEL                =      0x00;
	static public final byte COMMAND_LEVEL_MOVE                         =      0x01;
	static public final byte COMMAND_LEVEL_STEP                         =      0x02;
	static public final byte COMMAND_LEVEL_STOP                         =      0x03;
	static public final byte COMMAND_LEVEL_MOVE_TO_LEVEL_WITH_ON_OFF    =      0x04;
	static public final byte COMMAND_LEVEL_MOVE_WITH_ON_OFF             =      0x05;
	static public final byte COMMAND_LEVEL_STEP_WITH_ON_OFF             =      0x06;
	static public final byte COMMAND_LEVEL_STOP_WITH_ON_OFF             =      0x07;

	/*** Level Control Move (Mode) Command values ***/
	static public final byte LEVEL_MOVE_UP                              =      0x00;
	static public final byte LEVEL_MOVE_DOWN                            =      0x01;

	/*** Level Control Step (Mode) Command values ***/
	static public final byte LEVEL_STEP_UP                              =      0x00;
	static public final byte LEVEL_STEP_DOWN                            =      0x01;

	/*********************************/
	/*** Alarms Cluster Attributes ***/
	/*********************************/
	// Alarm Information
	static public final short ATTRID_ALARM_COUNT                         =      0x0000;

	/*******************************/
	/*** Alarms Cluster Commands ***/
	/*******************************/
	static public final byte COMMAND_ALARMS_RESET                       =      0x00;
	static public final byte COMMAND_ALARMS_RESET_ALL                   =      0x01;
	static public final byte COMMAND_ALARMS_GET                         =      0x02;
	static public final byte COMMAND_ALARMS_RESET_LOG                   =      0x03;

	static public final byte COMMAND_ALARMS_ALARM                       =      0x00;
	static public final byte COMMAND_ALARMS_GET_RSP                     =      0x01;

	/*******************************/
	/*** Time Cluster Attributes ***/
	/*******************************/
	static public final byte ATTRID_TIME_TIME                           =      0x00;
	static public final byte ATTRID_TIME_STATUS                         =      0x01;

	/*** TimeStatus Attribute bits ***/
	static public final byte TIME_STATUS_MASTER                         =      0x01;
	static public final byte TIME_STATUS_SYNCH                          =      0x02;

	/*****************************/
	/*** Time Cluster Commands ***/
	/*****************************/
	// No cluster specific commands

	/***********************************/
	/*** RSSI Location Cluster Attributes ***/
	/***********************************/
	// Location Information
	static public final short ATTRID_LOCATION_TYPE                       =      0x0000;
	static public final short ATTRID_LOCATION_METHOD                     =      0x0001;
	static public final short ATTRID_LOCATION_AGE                        =      0x0002;
	static public final short ATTRID_LOCATION_QUALITY_MEASURE            =      0x0003;

	static public final short ATTRID_LOCATION_NUM_DEVICES                =      0x0004;

	// Location Settings
	static public final short ATTRID_LOCATION_COORDINATE1                =      0x0010;
	static public final short ATTRID_LOCATION_COORDINATE2                =      0x0011;
	static public final short ATTRID_LOCATION_COORDINATE3                =      0x0012;
	static public final short ATTRID_LOCATION_POWER                      =      0x0013;
	static public final short ATTRID_LOCATION_PATH_LOSS_EXPONENT         =      0x0014;
	static public final short ATTRID_LOCATION_REPORT_PERIOD              =      0x0015;
	static public final short ATTRID_LOCATION_CALC_PERIOD                =      0x0016;
	static public final short ATTRID_LOCATION_NUM_RSSI_MEASUREMENTS      =      0x0017;

	/*** Location Type attribute bits ***/
	static public final byte LOCATION_TYPE_ABSOLUTE                     =      0x01;
	static public final byte LOCATION_TYPE_2_D                          =      0x02;
	static public final byte LOCATION_TYPE_COORDINATE_SYSTEM            =      0x0C;

	/*** Location Method attribute values ***/
	static public final byte LOCATION_METHOD_LATERATION                 =      0x00;
	static public final byte LOCATION_METHOD_SIGNPOSTING                =      0x01;
	static public final byte LOCATION_METHOD_RF_FINGER_PRINT            =      0x02;
	static public final byte LOCATION_METHOD_OUT_OF_BAND                =      0x03;

	/*********************************/
	/*** Location Cluster Commands ***/
	/*********************************/
	static public final byte COMMAND_LOCATION_SET_ABSOLUTE               =      0x00;
	static public final byte COMMAND_LOCATION_SET_DEV_CFG                =      0x01;
	static public final byte COMMAND_LOCATION_GET_DEV_CFG                =      0x02;
	static public final byte COMMAND_LOCATION_GET_DATA                   =      0x03;

	static public final byte COMMAND_LOCATION_DEV_CFG_RSP                =      0x00;
	static public final byte COMMAND_LOCATION_DATA_RSP                   =      0x01;
	static public final byte COMMAND_LOCATION_DATA_NOTIF                 =      0x02;
	static public final byte COMMAND_LOCATION_COMPACT_DATA_NOTIF         =      0x03;
	static public final byte COMMAND_LOCATION_RSSI_PING                  =      0x04;

	// The maximum number of characters to allow in a scene's name
	// remember that the first byte is the length
	static public final byte ZCL_GEN_SCENE_NAME_LEN                    =       16;

	// The maximum length of the scene extension field:
	//   2 + 1 + 1 for On/Off cluster (onOff attibute)
	//   2 + 1 + 1 for Level Control cluster (currentLevel attribute)
	//   2 + 1 + 4 for Color Control cluster (currentX/currentY attributes)
	static public final byte ZCL_GEN_SCENE_EXT_LEN                   =         15;

	// The maximum number of entries in the Scene table
	static public final byte ZCL_GEN_MAX_SCENES                    =           16;





	// General Clusters
	static public final short  ZCL_CLUSTER_ID_GEN_BASIC                      =      0x0000;
	static public final short  ZCL_CLUSTER_ID_GEN_POWER_CFG                  =      0x0001;
	static public final short  ZCL_CLUSTER_ID_GEN_DEVICE_TEMP_CONFIG         =      0x0002;
	static public final short  ZCL_CLUSTER_ID_GEN_IDENTIFY                   =      0x0003;
	static public final short  ZCL_CLUSTER_ID_GEN_GROUPS                     =      0x0004;
	static public final short  ZCL_CLUSTER_ID_GEN_SCENES                     =      0x0005;
	static public final short  ZCL_CLUSTER_ID_GEN_ON_OFF                     =      0x0006;
	static public final short  ZCL_CLUSTER_ID_GEN_ON_OFF_SWITCH_CONFIG       =      0x0007;
	static public final short  ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL              =      0x0008;
	static public final short  ZCL_CLUSTER_ID_GEN_ALARMS                     =      0x0009;
	static public final short  ZCL_CLUSTER_ID_GEN_TIME                       =      0x000A;
	static public final short  ZCL_CLUSTER_ID_GEN_LOCATION                   =      0x000B;
	static public final short  ZCL_CLUSTER_ID_GEN_KEY_ESTABLISHMENT          =      0x0800;

	// Closures Clusters
	static public final short  ZCL_CLUSTER_ID_CLOSURES_SHADE_CONFIG          =      0x0100;

	// HVAC Clusters
	static public final short  ZCL_CLUSTER_ID_HVAC_PUMP_CONFIG_CONTROL       =      0x0200;
	static public final short  ZCL_CLUSTER_ID_HAVC_THERMOSTAT                =      0x0201;
	static public final short  ZCL_CLUSTER_ID_HAVC_FAN_CONTROL               =      0x0202;
	static public final short  ZCL_CLUSTER_ID_HAVC_DIHUMIDIFICATION_CONTROL  =      0x0203;
	static public final short  ZCL_CLUSTER_ID_HAVC_USER_INTERFACE_CONFIG     =      0x0204;

	// Lighting Clusters
	static public final short  ZCL_CLUSTER_ID_LIGHTING_COLOR_CONTROL         =      0x0300;
	static public final short  ZCL_CLUSTER_ID_LIGHTING_BALLAST_CONFIG        =      0x0301;

	// Measurement and Sensing Clusters
	static public final short  ZCL_CLUSTER_ID_MS_ILLUMINANCE_MEASUREMENT     =      0x0400;
	static public final short  ZCL_CLUSTER_ID_MS_ILLUMINANCE_LEVEL_SENSING_CONFIG  = 0x0401;
	static public final short  ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT     =      0x0402;
	static public final short  ZCL_CLUSTER_ID_MS_PRESSURE_MEASUREMENT        =      0x0403;
	static public final short  ZCL_CLUSTER_ID_MS_FLOW_MEASUREMENT            =      0x0404;
	static public final short  ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY           =      0x0405;
	static public final short  ZCL_CLUSTER_ID_MS_OCCUPANCY_SENSING           =      0x0406;

	// Security and Safety (SS) Clusters
	static public final short  ZCL_CLUSTER_ID_SS_IAS_ZONE                    =      0x0500;
	static public final short  ZCL_CLUSTER_ID_SS_IAS_ACE                     =      0x0501;
	static public final short  ZCL_CLUSTER_ID_SS_IAS_WD                      =      0x0502;

	// Protocol Interfaces
	static public final short  ZCL_CLUSTER_ID_PI_GENERIC_TUNNEL              =      0x0600;
	static public final short  ZCL_CLUSTER_ID_PI_BACNET_PROTOCOL_TUNNEL      =      0x0601;
	static public final short  ZCL_CLUSTER_ID_PI_11073_PROTOCOL_TUNNEL       =      0x0614;

	// Advanced Metering Initiative (SE) Clusters 
	static public final short  ZCL_CLUSTER_ID_SE_PRICING                     =      0x0700;
	static public final short  ZCL_CLUSTER_ID_SE_LOAD_CONTROL                =      0x0701;
	static public final short  ZCL_CLUSTER_ID_SE_SIMPLE_METERING             =      0x0702;
	static public final short  ZCL_CLUSTER_ID_SE_MESSAGE                     =      0x0703;
	static public final short  ZCL_CLUSTER_ID_SE_REGISTRATION                =      0x0704;
	static public final short  ZCL_CLUSTER_ID_SE_SE_TUNNELING                =      0x0705;
	static public final short  ZCL_CLUSTER_ID_SE_PRE_PAYMENT                 =      0x0706  ;

	/*** Frame Control bit mask ***/
	static public final byte  ZCL_FRAME_CONTROL_TYPE                   =      0x03;
	static public final byte  ZCL_FRAME_CONTROL_MANU_SPECIFIC          =      0x04;
	static public final byte  ZCL_FRAME_CONTROL_DIRECTION              =      0x08;
	static public final byte  ZCL_FRAME_CONTROL_DISABLE_DEFAULT_RSP    =      0x10;

	/*** Frame Types ***/
	static public final byte  ZCL_FRAME_TYPE_PROFILE_CMD               =      0x00;
	static public final byte  ZCL_FRAME_TYPE_SPECIFIC_CMD              =      0x01;

	/*** Frame Client/Server Directions ***/
	static public final byte  ZCL_FRAME_CLIENT_SERVER_DIR              =      0x00;
	static public final byte  ZCL_FRAME_SERVER_CLIENT_DIR              =      0x01;

	/*** Chipcon Manufacturer Code ***/
	static public final short  CC_MANUFACTURER_CODE                     =      0x1001;

	/*** Foundation Command IDs ***/
	static public final byte  ZCL_CMD_READ                             =      0x00;
	static public final byte  ZCL_CMD_READ_RSP                         =      0x01;
	static public final byte  ZCL_CMD_WRITE                            =      0x02;
	static public final byte  ZCL_CMD_WRITE_UNDIVIDED                  =      0x03;
	static public final byte  ZCL_CMD_WRITE_RSP                        =      0x04;
	static public final byte  ZCL_CMD_WRITE_NO_RSP                     =      0x05;
	static public final byte  ZCL_CMD_CONFIG_REPORT                    =      0x06;
	static public final byte  ZCL_CMD_CONFIG_REPORT_RSP                =      0x07;
	static public final byte  ZCL_CMD_READ_REPORT_CFG                  =      0x08;
	static public final byte  ZCL_CMD_READ_REPORT_CFG_RSP              =      0x09;
	static public final byte  ZCL_CMD_REPORT                           =      0x0a;
	static public final byte  ZCL_CMD_DEFAULT_RSP                      =      0x0b;
	static public final byte  ZCL_CMD_DISCOVER                         =      0x0c;
	static public final byte  ZCL_CMD_DISCOVER_RSP                     =      0x0d;

//	#define ZCL_CMD_MAX                                     ZCL_CMD_DISCOVER_RSP

	/*** Data Types ***/
	static public final byte  ZCL_DATATYPE_NO_DATA                     =      0x00;
	static public final byte  ZCL_DATATYPE_DATA8                       =      0x08;
	static public final byte  ZCL_DATATYPE_DATA16                      =      0x09;
	static public final byte  ZCL_DATATYPE_DATA24                      =      0x0a;
	static public final byte  ZCL_DATATYPE_DATA32                      =      0x0b;
	static public final byte  ZCL_DATATYPE_BOOLEAN                     =      0x10;
	static public final byte  ZCL_DATATYPE_BITMAP8                     =      0x18;
	static public final byte  ZCL_DATATYPE_BITMAP16                    =      0x19;
	static public final byte  ZCL_DATATYPE_BITMAP24                    =      0x1a;
	static public final byte  ZCL_DATATYPE_BITMAP32                    =      0x1b;
	static public final byte  ZCL_DATATYPE_UINT8                       =      0x20;
	static public final byte  ZCL_DATATYPE_UINT16                      =      0x21;
	static public final byte  ZCL_DATATYPE_UINT24                      =      0x22;
	static public final byte  ZCL_DATATYPE_UINT32                      =      0x23;
	static public final byte  ZCL_DATATYPE_UINT40                      =      0x24;
	static public final byte  ZCL_DATATYPE_UINT48                      =      0x25;
	static public final byte  ZCL_DATATYPE_INT8                        =      0x28;
	static public final byte  ZCL_DATATYPE_INT16                       =      0x29;
	static public final byte  ZCL_DATATYPE_INT24                       =      0x2a;
	static public final byte  ZCL_DATATYPE_INT32                       =      0x2b;
	static public final byte  ZCL_DATATYPE_ENUM8                       =      0x30;
	static public final byte  ZCL_DATATYPE_ENUM16                      =      0x31;
	static public final byte  ZCL_DATATYPE_SEMI_PREC                   =      0x38;
	static public final byte  ZCL_DATATYPE_SINGLE_PREC                 =      0x39;
	static public final byte  ZCL_DATATYPE_DOUBLE_PREC                 =      0x3a;
	static public final byte  ZCL_DATATYPE_OCTET_STR                   =      0x41;
	static public final byte  ZCL_DATATYPE_CHAR_STR                    =      0x42;
	static public final byte  ZCL_DATATYPE_LONG_OCTET_STR              =      0x43;
	static public final byte  ZCL_DATATYPE_LONG_CHAR_STR               =      0x44;
	static public final byte  ZCL_DATATYPE_TOD                         =     (byte)0xe0;
	static public final byte  ZCL_DATATYPE_DATE                        =       (byte)0xe1;
	static public final byte  ZCL_DATATYPE_UTC                         =       (byte)0xe2;
	static public final byte  ZCL_DATATYPE_CLUSTER_ID                  =       (byte)0xe8;
	static public final byte  ZCL_DATATYPE_ATTR_ID                     =       (byte)0xe9;
	static public final byte  ZCL_DATATYPE_BAC_OID                     =       (byte)0xea;
	static public final byte  ZCL_DATATYPE_IEEE_ADDR                   =       (byte)0xf0;
	static public final byte  ZCL_DATATYPE_UNKNOWN                     =       (byte)0xff;

	/*** Error Status Codes ***/
	static public final byte  ZCL_STATUS_SUCCESS                       =      0x00;
	static public final byte  ZCL_STATUS_FAILURE                       =      0x01;
	// 0x02-0x7F are reserved.
	static public final byte  ZCL_STATUS_MALFORMED_COMMAND             =       (byte)0x80;
	static public final byte  ZCL_STATUS_UNSUP_CLUSTER_COMMAND         =       (byte)0x81;
	static public final byte  ZCL_STATUS_UNSUP_GENERAL_COMMAND         =       (byte)0x82;
	static public final byte  ZCL_STATUS_UNSUP_MANU_CLUSTER_COMMAND    =       (byte)0x83;
	static public final byte  ZCL_STATUS_UNSUP_MANU_GENERAL_COMMAND    =       (byte)0x84;
	static public final byte  ZCL_STATUS_INVALID_FIELD                 =       (byte)0x85;
	static public final byte  ZCL_STATUS_UNSUPPORTED_ATTRIBUTE         =       (byte)0x86;
	static public final byte  ZCL_STATUS_INVALID_VALUE                 =       (byte)0x87;
	static public final byte  ZCL_STATUS_READ_ONLY                     =       (byte)0x88;
	static public final byte  ZCL_STATUS_INSUFFICIENT_SPACE            =       (byte)0x89;
	static public final byte  ZCL_STATUS_DUPLICATE_EXISTS              =       (byte)0x8a;
	static public final byte  ZCL_STATUS_NOT_FOUND                     =       (byte)0x8b;
	static public final byte  ZCL_STATUS_UNREPORTABLE_ATTRIBUTE        =       (byte)0x8c;
	static public final byte  ZCL_STATUS_INVALID_DATA_TYPE             =       (byte)0x8d;
	// 0xbd-bf are reserved.
	static public final byte  ZCL_STATUS_HARDWARE_FAILURE              =       (byte)0xc0;
	static public final byte  ZCL_STATUS_SOFTWARE_FAILURE              =       (byte)0xc1;
	static public final byte  ZCL_STATUS_CALIBRATION_ERROR             =       (byte)0xc2;
	// 0xc3-0xff are reserved.
	static public final byte  ZCL_STATUS_CMD_HAS_RSP                   =       (byte)0xFF; // Non-standard status (used for Default Rsp)

	/*** Attribute Access Control - bit masks ***/
	static public final byte  ACCESS_CONTROL_READ                      =      0x01;
	static public final byte  ACCESS_CONTROL_WRITE                     =      0x02;
	static public final byte  ACCESS_CONTROL_COMMAND                   =      0x04;

	static public final short  ZCL_INVALID_CLUSTER_ID                   =      (short)0xFFFF;
	static public final short  ZCL_ATTR_ID_MAX                          =      (short)0xFFFF;

	// Used by Configure Reporting Command
	static public final byte  ZCL_SEND_ATTR_REPORTS                    =      0x00;
	static public final byte  ZCL_EXPECT_ATTR_REPORTS                  =      0x01;





	static public final Map<Short, String> clusterNames= new HashMap<Short, String>();
	static{
		clusterNames.put(ZCL_CLUSTER_ID_GEN_BASIC,"基本信息");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_POWER_CFG,"电源配置");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_DEVICE_TEMP_CONFIG ,"温度配置");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_IDENTIFY ,"标示");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_GROUPS ,"群组");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_SCENES ,"场景");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_ON_OFF ,"开关");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_ON_OFF_SWITCH_CONFIG,"开关配置");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL ,"量级");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_ALARMS,"报警");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_TIME,"时间");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_LOCATION ,"位置");
		clusterNames.put(ZCL_CLUSTER_ID_GEN_KEY_ESTABLISHMENT ,"密码设立");

		// Closures Clusters
		clusterNames.put(ZCL_CLUSTER_ID_CLOSURES_SHADE_CONFIG,"百叶设置");

		// HVAC Clusters
		clusterNames.put(ZCL_CLUSTER_ID_HVAC_PUMP_CONFIG_CONTROL,"泵设置");
		clusterNames.put(ZCL_CLUSTER_ID_HAVC_THERMOSTAT,"thermostat");
		clusterNames.put(ZCL_CLUSTER_ID_HAVC_FAN_CONTROL ,"风扇控制");
		clusterNames.put(ZCL_CLUSTER_ID_HAVC_DIHUMIDIFICATION_CONTROL,"湿度控制");
		clusterNames.put(ZCL_CLUSTER_ID_HAVC_USER_INTERFACE_CONFIG,"界面设置");

		// Lighting Clusters
		clusterNames.put(ZCL_CLUSTER_ID_LIGHTING_COLOR_CONTROL,"灯光颜色控制");
		clusterNames.put(ZCL_CLUSTER_ID_LIGHTING_BALLAST_CONFIG,"灯光ballast控制");

		// Measurement and Sensing Clusters
		clusterNames.put(ZCL_CLUSTER_ID_MS_ILLUMINANCE_MEASUREMENT ,"亮度度量");
		clusterNames.put(ZCL_CLUSTER_ID_MS_ILLUMINANCE_LEVEL_SENSING_CONFIG ,"亮度水平感知配置");
		clusterNames.put(ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT ,"温度测量");
		clusterNames.put(ZCL_CLUSTER_ID_MS_PRESSURE_MEASUREMENT ,"压力测量");
		clusterNames.put(ZCL_CLUSTER_ID_MS_FLOW_MEASUREMENT ,"流量测量");
		clusterNames.put(ZCL_CLUSTER_ID_MS_RELATIVE_HUMIDITY,"相对湿度");
		clusterNames.put(ZCL_CLUSTER_ID_MS_OCCUPANCY_SENSING ,"占位感应");

		// Security and Safety (SS) Clusters
		clusterNames.put(ZCL_CLUSTER_ID_SS_IAS_ZONE,"侵入报警地带");
		clusterNames.put(ZCL_CLUSTER_ID_SS_IAS_ACE,"侵入报警辅助控制");
		clusterNames.put(ZCL_CLUSTER_ID_SS_IAS_WD,"侵入报警警告");
	}
}
